package com.fenghongzhang.day002;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;

import java.io.File;

public class ImageLoader {
    public static void loadUrl(Context context, String url, ImageView imageView){
        Glide.with(context).load(url).into(imageView);
    }
    public static void loadFile(Context context, File file, ImageView imageView){
        Glide.with(context).load(file).into(imageView);
    }

    public static void loadCircle(Context context, String url, ImageView imageView){
        Glide.with(context).load(url).apply(new RequestOptions().circleCrop()).into(imageView);
    }

    public static void resize(Context context, String url, ImageView imageView){
        Glide.with(context).load(url).override(100,100).into(imageView);
    }
}
